GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

getCurrentRecords.js ➔ ???   B
last analyzed

Complexity

Conditions 3
Paths 3

Size

Total Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 3
nc 3
dl 0
loc 40
rs 8.8571
c 0
b 0
f 0
nop 7
1
export const getCurrentRecords = (
2
    dataSource,
3
    pageIndex,
4
    pageSize,
5
    infinite,
6
    viewableIndex,
7
    viewableCount,
8
    bufferMultiplier
9
) => {
10
11
    if (!dataSource) {
12
        return {};
13
    }
14
15
    if (infinite) {
16
        const start = Math.max(
17
            viewableIndex - viewableCount * bufferMultiplier,
18
            0
19
        );
20
21
        const end = Math.min(
22
            viewableIndex + viewableCount * (bufferMultiplier + 1),
23
            dataSource.currentRecords.count()
24
        );
25
26
        return {
27
            data: dataSource.currentRecords.slice(start, end),
28
            startIndex: start,
29
            endIndex: end
30
        };
31
    }
32
33
    return {
34
        data: dataSource.data.slice(
35
            pageIndex * pageSize, (pageIndex + 1) * pageSize
36
        ),
37
        startIndex: null,
38
        endIndex: null
39
    };
40
};
41